from langchain_core.messages import SystemMessage, HumanMessage
from langchain_openai import ChatOpenAI
import getpass
import os

OPEN_AI_KEY = 'sk-tGUzX0e9iibAF4U5cSTQKzyHwwlpu0Sf16VZbtlp6SiExeyW'

# if not os.environ.get("OPENAI_API_KEY"):
#     os.environ["OPENAI_API_KEY"] = getpass.getpass(OPEN_AI_KEY)

model = ChatOpenAI(model="ictrek/qwen7b:32k", openai_api_key="ollama", openai_api_base="http://10.2.4.31:11434/v1/")

messages = [
    SystemMessage("请将以下内容翻译成英语"),
    HumanMessage("您好，怎么称呼您？")
]

result = model.invoke(messages)

print(result.content)
